<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<%@include file="/common/taglibs.jsp" %>
<%@include file="/common/javascript.jsp" %>
<html>
<head>
<meta charset="utf-8">
<title>土地计划</title>
	
    <script type="text/javascript">
		function downFile(obj,id){
		  obj.href="landAction_downFile?attachment.id="+id+"&t="+Math.random();
		   return false;
		}
		
		function viewFile(obj,id){
		  obj.href="landAction_viewFile?attachment.id="+id+"&t="+Math.random();
		   return false;
		}
		
		$(function(){
			$("#dg").datagrid({url:'landAtta?land.id=${land.id}',rownumbers:true,singleSelect:false,selectOnCheck:true,
					fitColumns:true,pagination:true,loadMsg:'数据加载中...',pageSize:5,
					frozenColumns:[[     
                  		{field:'ck',checkbox:true}
            		]],
					columns:[[  
						 {field:'id',title:"编号",width:120,align:'center',hidden:true}, 
						{field:'name',title:"名称",width:100,align:'center'}, 
						{field:'remark',title:"备注",width:200,align:'center'},
						
						{field:'ope',title:"操作",width:100,align:'center'}
					]]  
			});
			
			$("#dg").datagrid('getPager').pagination({//分页栏下方文字显示
				showPageList:false,
				beforePageText:'第',
				afterPageText: '页    共 {pages} 页',            
			    displayMsg:'当前显示   从第{from}条到{to}条     共{total}条记录'
			});
				
			
			
			$("#btnDelete").bind('click',function(){
				var rows=$("#dg").datagrid('getSelections');
				if(rows!=null && rows.length>0){
					$.messager.confirm('提示','确定要删除吗？',function(r){
						if (r){  
							var ids="";
							for(var i=0;i<rows.length;i++){
								ids+=rows[i].id+",";
							}
							$.post("landAction_deleteAtta",{ids:ids},function(data){
								var data = eval('(' + data + ')');
								if (!data.success){ //删除失败  
									$.messager.alert('提示',"错误"+data.message,"info");
        						}else{//删除成功
        							$.messager.alert('提示',data.message,"info",function(){
        								$('#dg').datagrid('reload'); //刷新网格
        							});
        						} 
							});
						}
					});
				}else{
					$.messager.alert('提示','请先选择要删除的数据项',"info");
				}
			});
			
			
		});
		
		function closeContent(){
			$("#content").dialog('close');
			$('#dg').datagrid('reload');
		}
		
	</script>
</head>

<body style="margin:0px; overflow-style:clear; padding:0px;">
	
    
    <div id="toolbar" style="background:#C9DFFF">
    	<c:if test="${permissionId==1}">
    		<a id="btnDelete" class="easyui-linkbutton" data-options="iconCls:'icon-delete',plain:'true'" style="text-align:center">删除</a>
        	
    	</c:if>
    	
    </div>
    <table id="dg"> </table>
    
    <div id="content" style="top: 100px;">
    	<iframe id='openFrame' name='openFrame' frameborder="0" scrolling="no"  src="" style="width:100%;height:95%;"></iframe> 
    </div> 
</body>
</html>
